home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume20 / dvi / patch01 next >
Encoding:
Text File  |  1991-05-25  |  12.9 KB  |  391 lines

  1. Newsgroups: comp.sources.misc
  2. From: Parag Patel <parag@hpsdeb.sde.hp.com>
  3. Subject:  v20i018:  dvi - C++ DVI filter for HP LaserJets, Patch01
  4. Message-ID: <1991May23.193542.4811@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: 69d19b544fb5b8e4fdbb693e903c428f
  6. Date: Thu, 23 May 1991 19:35:42 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Parag Patel <parag@hpsdeb.sde.hp.com>
  10. Posting-number: Volume 20, Issue 18
  11. Archive-name: dvi/patch01
  12. Patch-To: dvi: Volume 19, Issue 64-66
  13.  
  14. This is the first bug-fix release for dvi.  The following is a list of
  15. modifications contained in this patch:
  16.     - dvi has been ported to Sparc - minor ifdef needed,
  17.     - version string was slightly modified so say_hello() in 
  18.           main.C works,
  19.         - also looks for fonts such as /path/cmr7.300pk and cmr7.300gf,
  20.         - Makefile was modified to allow overriding the default font 
  21.           search path.
  22.  
  23. To apply this patch cd to the dvi source directory, unshar this file
  24. and the "patch < patch-1.6-1.7".
  25.  
  26.     -- Parag
  27.  
  28. ---- Cut Here and feed the following to sh ----
  29. #!/bin/sh
  30. # This is a shell archive (produced by shar 3.49)
  31. # To extract the files from this archive, save it to a file, remove
  32. # everything above the "!/bin/sh" line above, and type "sh file_name".
  33. #
  34. # made 05/23/1991 17:49 UTC by parag@hpsdeb
  35. # Source directory /users/parag/tools/tex/dvi/VERSIONS
  36. #
  37. # existing files will NOT be overwritten unless -c is specified
  38. #
  39. # This shar contains:
  40. # length  mode       name
  41. # ------ ---------- ------------------------------------------
  42. #  10794 -rw-r--r-- patch-1.6-1.7
  43. #
  44. # ============= patch-1.6-1.7 ==============
  45. if test -f 'patch-1.6-1.7' -a X"$1" != X"-c"; then
  46.     echo 'x - skipping patch-1.6-1.7 (File already exists)'
  47. else
  48. sed 's/^X//' << 'SHAR_EOF' > 'patch-1.6-1.7' &&
  49. *** tmp/Makefile    Thu May  9 13:25:23 1991
  50. --- Makefile    Mon May 20 19:05:45 1991
  51. ***************
  52. *** 1,5
  53. X  # Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  54. ! # $Header: Makefile,v 1.22 91/05/09 14:25:22 hmgr Exp $
  55. X  
  56. X  CXX = CC
  57. X  .SUFFIXES: .C
  58. X
  59. --- 1,5 -----
  60. X  # Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  61. ! # $Header: Makefile,v 1.24 91/05/20 20:05:44 hmgr Exp $
  62. X  
  63. X  CXX = CC
  64. X  .SUFFIXES: .C
  65. ***************
  66. *** 7,13
  67. X      $(CXX) $(CFLAGS) -c $<
  68. X  
  69. X  # other system-dependent options - use only one of the -D<sys> macros:
  70. ! #CFLAGS = -O -DBSD -DMSDOS
  71. X  CFLAGS = -g
  72. X  LIBS = -lm
  73. X  
  74. X
  75. --- 7,17 -----
  76. X      $(CXX) $(CFLAGS) -c $<
  77. X  
  78. X  # other system-dependent options - use only one of the -D<sys> macros:
  79. ! # -DBSD            for BSD derivatives
  80. ! # -DMSDOS        for Zortech C++ - also run "make msdos-files"
  81. ! # -DFREE_TAKES_CHAR    if you have a free(char*) instead of free(void*)
  82. ! # -DHP2686_FPATH=/path1:/path2:...
  83. ! #            to modify the default font search path
  84. X  CFLAGS = -g
  85. X  LIBS = -lm
  86. X  
  87. *** tmp/README    Fri Feb 22 15:31:52 1991
  88. --- README    Thu May 23 10:45:10 1991
  89. ***************
  90. *** 1,4
  91. ! $Header: README,v 1.10 91/02/22 16:31:45 hmgr Exp $
  92. X  
  93. X  Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  94. X  You can do what you wish with this as long as
  95. X
  96. --- 1,4 -----
  97. ! $Header: README,v 1.15 91/05/23 11:45:11 hmgr Exp $
  98. X  
  99. X  Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  100. X  You can do what you wish with this as long as
  101. ***************
  102. *** 9,20
  103. X  software.  It is completely unsupported.  You're on your own.
  104. X  
  105. X  
  106. ! This is version 1.4 of my TeX DVI filter.  I'd written it about 4 years
  107. ! ago since, at that time, the only LaserJet DVI filters available to me
  108. ! were in Pascal and ungodly slow.  Anyway, it's been pointed out to me
  109. ! that "dvi" still one of the better DVIs around, so I figured it was time
  110. ! to get off my duff and make it available to the world at large.  Or at
  111. ! small - I'm not picky.
  112. X  
  113. X  The man-page lists all the pertinent details, but here's some
  114. X  highlights:
  115. X
  116. --- 9,20 -----
  117. X  software.  It is completely unsupported.  You're on your own.
  118. X  
  119. X  
  120. ! This is the TeX DVI filter which I'd written it about 4 years ago when,
  121. ! at that time, the only LaserJet DVI filters available to me were in
  122. ! Pascal and ungodly slow.  Anyway, it's been pointed out to me that "dvi"
  123. ! still one of the better DVIs around, so I figured it was time to get off
  124. ! my duff and make it available to the world at large.  Or at small - I'm
  125. ! not picky.
  126. X  
  127. X  The man-page lists all the pertinent details, but here's some
  128. X  highlights:
  129. ***************
  130. *** 47,57
  131. X  among other things.)
  132. X  
  133. X  Dvi currently compiles right up on HP-UX 7.0, 6.5, and 6.2 (s300s or
  134. ! s800s), BSD4.3 (Tahoe) on hp300 hardware, and Zortech C++ on MSDOS.  I
  135. ! use AT&T's C++ 2.0 (cfront) and not G++ on all my Unix boxes.  I do NOT
  136. ! use C++ streams, but do use stdio.  I have NO idea how much work it'll
  137. ! take to get it running on other systems or using G++, but it shouldn't
  138. ! be too hard.
  139. X  
  140. X  
  141. X  Anyway, just type "make" to build a debug version of "dvi".  Then copy
  142. X
  143. --- 47,57 -----
  144. X  among other things.)
  145. X  
  146. X  Dvi currently compiles right up on HP-UX 7.0, 6.5, and 6.2 (s300s or
  147. ! s800s), BSD4.3 (Tahoe) on hp300 hardware, Zortech C++ on MSDOS, and
  148. ! Sparc.  I use AT&T's C++ 2.0 (cfront) and not G++ on all my Unix boxes.
  149. ! I do NOT use C++ streams, but do use stdio.  I have NO idea how much
  150. ! work it'll take to get it running on other systems or using G++, but it
  151. ! shouldn't be too hard.
  152. X  
  153. X  
  154. X  Anyway, just type "make" to build a debug version of "dvi".  Then copy
  155. ***************
  156. *** 57,63
  157. X  Anyway, just type "make" to build a debug version of "dvi".  Then copy
  158. X  "dvi" and "dvi.1" to whatever names and whatever places you want them.
  159. X  You will have to define -DMSDOS or -DBSD in the Makefile if you are on
  160. ! those systems.
  161. X  
  162. X  Use "make ljdump" to build the "ljdump" program.  This is useful for
  163. X  debugging dvi by converting PCL to a semi-human-readable dump.
  164. X
  165. --- 57,63 -----
  166. X  Anyway, just type "make" to build a debug version of "dvi".  Then copy
  167. X  "dvi" and "dvi.1" to whatever names and whatever places you want them.
  168. X  You will have to define -DMSDOS or -DBSD in the Makefile if you are on
  169. ! those systems.  My Sparc also needed -DFREE_TAKES_CHAR.
  170. X  
  171. X  Use "make ljdump" to build the "ljdump" program.  This is useful for
  172. X  debugging dvi by converting PCL to a semi-human-readable dump.
  173. ***************
  174. *** 74,76
  175. X  
  176. X  
  177. X      -- Parag Patel <parag@sde.hp.com>
  178. X
  179. --- 74,89 -----
  180. X  
  181. X  
  182. X      -- Parag Patel <parag@sde.hp.com>
  183. + --------------------REVISION-INFO----------------------
  184. + 1.6    released on HP INTERX Contrib Tape and comp.sources.misc
  185. + 1.7    first bug-fix release
  186. +     files modified: Makefile README extern.h main.C readfont.C hp2686.h
  187. +     ported to Sparc - minor ifdef needed
  188. +     version string slightly modified so say_hello() in main.C works
  189. +     also look for fonts such as /path/cmr7.300pk and cmr7.300gf
  190. +     allow overriding default font search path from Makefile
  191. *** tmp/extern.h    Fri Feb 22 14:59:13 1991
  192. --- extern.h    Fri May 17 15:28:16 1991
  193. ***************
  194. *** 1,5
  195. X  // Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  196. ! // $Header: extern.h,v 1.24 91/02/22 15:59:02 hmgr Exp $
  197. X  
  198. X  // externs for various LaserJet+ DVI filter functions
  199. X  //
  200. X
  201. --- 1,5 -----
  202. X  // Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  203. ! // $Header: extern.h,v 1.25 91/05/17 16:28:17 hmgr Exp $
  204. X  
  205. X  // externs for various LaserJet+ DVI filter functions
  206. X  //
  207. ***************
  208. *** 91,97
  209. X  // convienient inlines - these would otherwise would have to go elsewhere
  210. X  
  211. X  inline char *strnew(size_t len) { return (char*)malloc(len + 1); }
  212. ! inline void  strfree(char *s) { if (s != NULL) free((void *)s); }
  213. X  inline char *strdup(const char *s)
  214. X      { return s != NULL ? strcpy((char*)malloc(strlen(s) + 1), s) : NULL; }
  215. X  inline boolean streq(const char *s1, const char *s2)
  216. X
  217. --- 91,101 -----
  218. X  // convienient inlines - these would otherwise would have to go elsewhere
  219. X  
  220. X  inline char *strnew(size_t len) { return (char*)malloc(len + 1); }
  221. ! #if FREE_TAKES_CHAR
  222. ! inline void  strfree(const char *s) { if (s != NULL) free((char *)s); }
  223. ! #else
  224. ! inline void  strfree(const char *s) { if (s != NULL) free((const void *)s); }
  225. ! #endif
  226. X  inline char *strdup(const char *s)
  227. X      { return s != NULL ? strcpy((char*)malloc(strlen(s) + 1), s) : NULL; }
  228. X  inline boolean streq(const char *s1, const char *s2)
  229. *** tmp/main.C    Tue Apr  2 16:50:35 1991
  230. --- main.C    Fri May 17 15:28:21 1991
  231. ***************
  232. *** 1,5
  233. X  // Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  234. ! static const char rcsid[] = "$Header: main.C,v 1.31 91/04/02 17:50:33 hmgr Exp $";
  235. X  
  236. X  // TeX DVI filter main() - just parses arguments and calls functions
  237. X  //
  238. X
  239. --- 1,5 -----
  240. X  // Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  241. ! static const char rcsid[] = "$Header: main.C,v 1.32 91/05/17 16:28:22 hmgr Exp $";
  242. X  
  243. X  // TeX DVI filter main() - just parses arguments and calls functions
  244. X  //
  245. ***************
  246. *** 7,13
  247. X  
  248. X  #include "defs.h"
  249. X  
  250. ! static char *const whatid = "@(#) dvi 1.6 (02 April 1991)";
  251. X  
  252. X  static void say_hello()
  253. X  {
  254. X
  255. --- 7,13 -----
  256. X  
  257. X  #include "defs.h"
  258. X  
  259. ! static char *const whatid = "@(#)dvi 1.7 (02 April 1991)";
  260. X  
  261. X  static void say_hello()
  262. X  {
  263. *** tmp/readfont.C    Tue Apr  2 16:50:29 1991
  264. --- readfont.C    Mon May 20 15:12:45 1991
  265. ***************
  266. *** 1,5
  267. X  // Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  268. ! static const char rcsid[] = "$Header: readfont.C,v 1.21 91/04/02 17:50:26 hmgr Exp $";
  269. X  
  270. X  // read font data from the METAFONT GF (generic font) files
  271. X  //
  272. X
  273. --- 1,5 -----
  274. X  // Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  275. ! static const char rcsid[] = "$Header: readfont.C,v 1.22 91/05/20 16:12:46 hmgr Exp $";
  276. X  
  277. X  // read font data from the METAFONT GF (generic font) files
  278. X  //
  279. ***************
  280. *** 31,36
  281. X      static char buf[MAXPATHLEN + 1];
  282. X      sprintf(buf, "%s/%s/%s%s", dir, mag, base, ext);
  283. X      char *path = buf;
  284. X      FILE *fp = fopen(path, F_READ);
  285. X      if (fp == NULL)
  286. X      return FALSE;
  287. X
  288. --- 31,38 -----
  289. X      static char buf[MAXPATHLEN + 1];
  290. X      sprintf(buf, "%s/%s/%s%s", dir, mag, base, ext);
  291. X      char *path = buf;
  292. +     debug(3, "looking for font file %s", path);
  293. X      FILE *fp = fopen(path, F_READ);
  294. X      if (fp == NULL)
  295. X      return FALSE;
  296. ***************
  297. *** 109,114
  298. X      if (tryfile(f, p.path, gfmagdir(p.dirs, f.mag), f.basename, ""))
  299. X          return;
  300. X      if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ""))
  301. X          return;
  302. X      }
  303. X      quit("Cannot find font file \"%s\" (at or near magnification %ld.%03ld) anywhere",
  304. X
  305. --- 111,124 -----
  306. X      if (tryfile(f, p.path, gfmagdir(p.dirs, f.mag), f.basename, ""))
  307. X          return;
  308. X      if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ""))
  309. +         return;
  310. +     char ext[30];
  311. +     sprintf(ext, ".%dpk", RESOLUTION);
  312. +     if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ext))
  313. +         return;
  314. +     sprintf(ext, ".%dgf", RESOLUTION);
  315. +     if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ext))
  316. X          return;
  317. X      }
  318. X      quit("Cannot find font file \"%s\" (at or near magnification %ld.%03ld) anywhere",
  319. *** tmp/hp2686.h    Fri Feb 22 14:58:59 1991
  320. --- hp2686.h    Mon May 20 19:05:50 1991
  321. ***************
  322. *** 1,5
  323. X  // Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  324. ! // $Header: hp2686.h,v 1.13 91/02/22 15:58:47 hmgr Exp $
  325. X  
  326. X  // HP2686 LaserJet+ device-specific definitions.
  327. X  // The LaserJet+ Reference Manual should be consulted for more
  328. X
  329. --- 1,5 -----
  330. X  // Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  331. ! // $Header: hp2686.h,v 1.14 91/05/20 20:05:52 hmgr Exp $
  332. X  
  333. X  // HP2686 LaserJet+ device-specific definitions.
  334. X  // The LaserJet+ Reference Manual should be consulted for more
  335. ***************
  336. *** 37,42
  337. X      void rule(double v, double h);
  338. X  };
  339. X  
  340. X  #define HP2686_FPATH "/usr/lib/tex/fontbits/laser:/usr/lib/tex/fnt:/usr/local/tex/fontbits/laser"
  341. X  
  342. X  // about 1 inch from both margins - tweaked until TeX test comes out right
  343. X
  344. --- 37,43 -----
  345. X      void rule(double v, double h);
  346. X  };
  347. X  
  348. + #ifndef HP2686_FPATH
  349. X  #define HP2686_FPATH "/usr/lib/tex/fontbits/laser:/usr/lib/tex/fnt:/usr/local/tex/fontbits/laser"
  350. X  #endif
  351. X  
  352. ***************
  353. *** 38,43
  354. X  };
  355. X  
  356. X  #define HP2686_FPATH "/usr/lib/tex/fontbits/laser:/usr/lib/tex/fnt:/usr/local/tex/fontbits/laser"
  357. X  
  358. X  // about 1 inch from both margins - tweaked until TeX test comes out right
  359. X  // when printed to a LaserJet - lots of fun with unprintable regions!
  360. X
  361. --- 39,45 -----
  362. X  
  363. X  #ifndef HP2686_FPATH
  364. X  #define HP2686_FPATH "/usr/lib/tex/fontbits/laser:/usr/lib/tex/fnt:/usr/local/tex/fontbits/laser"
  365. + #endif
  366. X  
  367. X  // about 1 inch from both margins - tweaked until TeX test comes out right
  368. X  // when printed to a LaserJet - lots of fun with unprintable regions!
  369. SHAR_EOF
  370. chmod 0644 patch-1.6-1.7 ||
  371. echo 'restore of patch-1.6-1.7 failed'
  372. Wc_c="`wc -c < 'patch-1.6-1.7'`"
  373. test 10794 -eq "$Wc_c" ||
  374.     echo 'patch-1.6-1.7: original size 10794, current size' "$Wc_c"
  375. fi
  376. exit 0
  377.  
  378. exit 0 # Just in case...
  379. -- 
  380. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  381. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  382. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  383. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  384.